<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>

<html>

 <head>
    
    <title>角色管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url = "${ctx}/security/roleplace";
		var basic_WUrl = "security/roleplace";
		var basic_Title="角色仓库管理";
		var show_Width=1000;
		var show_Hight=500;
		var roleType = '${roleType}';
		function searchAP(param){
			multipleSearch("#table1",true,"","${ctx}/security/roleplace/list.do?ID="+param);
		}
		
		$(function(){
			var grid = $("#table1").ligerGrid({
		        columns: [
		                  { display: '角色名称', name: 'rolename', width: 120 },
		                  { display: '角色描述', name: 'roledescribe', width: 120 },
		                  { display: '类型', name: 'type', width: 120 },
		                  { display: '资源编码', name: 'resourcescode', width: 150},
		                  { display: '资源名称', name: 'resourcesname', width: 120 },
		                  { display: '创建时间', name: 'dcrtime', width: 120,
		                	  render: function (item){
		                		  var cdate=new Date(item.dcrtime);
		                		  return formatDate(cdate,"yyyy-MM-dd HH:mm:ss")
		                	  }
		                  },
		                  { display: '备注', name: 'remark', width: 120 }
		                      ],  usePager: true,pageSize:30,
		                     // url : basic_Url+"/list.do",
		                      width: '100%', height: '98%', checkbox: true,rownumbers:true,           
		                      toolbar: { items: [
													  { text: '增加', click: addrp, img: '../../js/ligerUI/skins/icons/add.gif' },
													  { line: true },
		                                              { text: '删除', click: del, img: '../../js/ligerUI/skins/icons/delete.gif' }
		                                              ]
		                                              }
		                  });
			$("#pageloading").hide();
			
			$("#layout1").ligerLayout({ leftWidth: 200,height: '100%',heightDiff:-24,space:4});
	    	
	    	var actionNodeID=null;
	    	var actionNodeText=null;
	    	
	    	$("#tree1").ligerTree({  
	    		 url: basic_Url+'/tree.do',
	    		 nodeWidth: 115,
	    		 checkbox: false,
	             slide: false,
	             onClick:function(node){
	            	 actionNodeID = node.data.id;
	            	 //actionNodeText=node.data.text;
	            	 multipleSearch("#table1",true,"",basic_Url+"/list.do?ID="+node.data.name+"&roleType="+roleType);
	             }
	         });
	    	
	    	function addrp(){
	    		if(actionNodeID==null){
	   				$.dialog.alert("请先选择左侧权限");
	   				return false;
	   			}
				var url = basic_WUrl+"/operation/add/"+actionNodeID+".do?roleType="+roleType;
				ShowIframeDialog("operate",basic_Title,url,show_Width,show_Hight);
			}
		});
	</script>
  </head>
<body>
     <!--  <div position="top">
          <div class="panelBar">
	            <ul class="toolBar">
		           <li><a class="add" onclick="addrp()">
		           <span>添加</span></a></li>
				   <li><a class="delete" onclick="del()"><span>删除</span></a></li>
				 
               </ul>
          </div>
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div> -->
       <div id="layout1">
            <div position="left" title="菜单管理">
            <div style="width:200px; height:450px; float:left;overflow:auto;  ">
   				 <ul id="tree1"></ul>
    		</div> 
            </div>
            <div position="center" title="菜单列表" id="table1">
            
            </div>  
        </div> 
  
</body>
</html>